<?php
include_once("../modules/checkA.php");
include_once("../../config.php"); 
$plate=select_one_line_all_items($table_Prefix."plate","mid = 'access_record'");
?>


<?
//用来判断当前系统属于什么板块
$system_part = $plate['mid']; 
?>
 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include_once(ROOT_PATH_.'/controlbase/modules/head.php'); ?>
</head>

<body>

 
 

<?php
//接收需要修改的数据的id
$new_detail_nid = addslashes($_REQUEST['nid']);

//传递过来的页面信息。返回的时候，会根据这些信息返回原来的页面
$nowpageid      = addslashes($_REQUEST['nowpageid']);
$sortby         = addslashes($_REQUEST['sortby']);
$term_nid       = addslashes($_REQUEST['term_nid']);
?>

<?if(!$new_detail_nid){?>

<script type="text/javascript">

    alert("数据异常，请重新操作");
    document.location.href = "../equipment/detail-list.php?nowpageid=<? echo $nowpageid ?>&sortby=<? echo $sortby?>&nid=<? echo $term_nid ?>&sys_part=<? echo $system_part ?>"

</script>
<?}?>

<?


$new_detail_ticketdate  = addslashes($_REQUEST['ticketdate']);
$new_detail_dealdate  = addslashes($_REQUEST['dealdate']);
$new_detail_principal   = addslashes($_REQUEST['principal']);
$new_detail_cost        = addslashes($_REQUEST['cost']);
$new_detail_remark      = addslashes($_REQUEST['remark']);
$new_detail_mark        = addslashes($_REQUEST['mark']);
$new_detail_status      = addslashes($_REQUEST['dealstatus']);
$new_detail_equipmentid = addslashes($_REQUEST['equipmentid']);
$new_detail_authur      = addslashes($_REQUEST['username']);


$new_detail_name  = addslashes($_REQUEST['returndate']);
$new_detail_returnremark = addslashes($_REQUEST['returnremark']);
$new_detail_equipmentid  = addslashes($_REQUEST['equipmentid']);




//设置需要搜索的表格的前缀后缀
$table_Suffix = $plate['table_Suffix'];
$table        = $table_Prefix . $table_Suffix;


$sql = "update $table SET
applydate  = '$new_detail_ticketdate',
payment        = '$new_detail_cost',
remark      = '$new_detail_remark',
mark        = '$new_detail_mark',
status      = '$new_detail_status',
equipmentid = '$new_detail_equipmentid',
authur      = '$new_detail_username'
where nid=$new_detail_nid";

$query = mysql_query($sql) or die ('更新数据失败');




mysql_close($con);

?>






<script type="text/javascript">

    alert("输入信息已保存，点击确认返回继续操作.");
    document.location.href = "detail-list.php?nowpageid=<? echo $nowpageid ?>&sortby=<? echo $sortby?>&nid=<? echo $term_nid ?>&sys_part=<? echo $system_part ?>&nav-itemed=equipment"

</script>


</body>